<!DOCTYPE html>



  


<html class="theme-next gemini use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="Hexo, NexT" />










<meta name="description" content="1title:hexo的目录结构  1.第一次玩hexo，今天了解一下hexo的每个目录的作用，设置一下全局的配置文件_config.yml的相关参数，记录一下12345678--config.yml--package.json--scaffolds--source    --_posts--themes--.gitignore--package.json  2.主目录介绍​    1)_conf">
<meta property="og:type" content="article">
<meta property="og:title" content="hexo目录结构">
<meta property="og:url" content="https://www.suichen.top/2020/03/20/hexo%E7%9B%AE%E5%BD%95%E7%BB%93%E6%9E%84/index.html">
<meta property="og:site_name" content="随尘的博客">
<meta property="og:description" content="1title:hexo的目录结构  1.第一次玩hexo，今天了解一下hexo的每个目录的作用，设置一下全局的配置文件_config.yml的相关参数，记录一下12345678--config.yml--package.json--scaffolds--source    --_posts--themes--.gitignore--package.json  2.主目录介绍​    1)_conf">
<meta property="article:published_time" content="2020-03-20T01:58:41.679Z">
<meta property="article:modified_time" content="2020-03-20T03:00:10.137Z">
<meta property="article:author" content="suichen">
<meta name="twitter:card" content="summary">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Gemini',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://www.suichen.top/2020/03/20/hexo目录结构/"/>





  <title>hexo目录结构 | 随尘的博客</title>
  








<meta name="generator" content="Hexo 4.2.0"></head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">随尘的博客</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/%20" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/%20" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://www.suichen.top/2020/03/20/hexo%E7%9B%AE%E5%BD%95%E7%BB%93%E6%9E%84/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="suichen">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="随尘的博客">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">hexo目录结构</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2020-03-20T09:58:41+08:00">
                2020-03-20
              </time>
            

            

            
          </span>

          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">title:hexo的目录结构</span><br></pre></td></tr></table></figure>

<h3 id="1-第一次玩hexo，今天了解一下hexo的每个目录的作用，设置一下全局的配置文件-config-yml的相关参数，记录一下"><a href="#1-第一次玩hexo，今天了解一下hexo的每个目录的作用，设置一下全局的配置文件-config-yml的相关参数，记录一下" class="headerlink" title="1.第一次玩hexo，今天了解一下hexo的每个目录的作用，设置一下全局的配置文件_config.yml的相关参数，记录一下"></a>1.第一次玩hexo，今天了解一下hexo的每个目录的作用，设置一下全局的配置文件_config.yml的相关参数，记录一下</h3><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">--config.yml</span><br><span class="line">--<span class="keyword">package</span>.json</span><br><span class="line">--scaffolds</span><br><span class="line">--source</span><br><span class="line">    --_posts</span><br><span class="line">--themes</span><br><span class="line">--.gitignore</span><br><span class="line">--<span class="keyword">package</span>.json</span><br></pre></td></tr></table></figure>

<h3 id="2-主目录介绍"><a href="#2-主目录介绍" class="headerlink" title="2.主目录介绍"></a>2.主目录介绍</h3><p>​    1)_config.yml:全局配置文件，网站的很多信息都在这里配置，诸如网站名称，副标题，描述，作者，语言，主题，部署等等参数。这个文件下面会做较为详细的介绍。需要直接配置。注意每个配置的“：”后要有一个空格问题。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br></pre></td><td class="code"><pre><span class="line"># Hexo Configuration</span><br><span class="line">## Docs: https:&#x2F;&#x2F;hexo.io&#x2F;docs&#x2F;configuration.html</span><br><span class="line">## Source: https:&#x2F;&#x2F;github.com&#x2F;hexojs&#x2F;hexo&#x2F;</span><br><span class="line"></span><br><span class="line"># Site</span><br><span class="line">title: Hexo #网站标题</span><br><span class="line">subtitle:   #网站副标题</span><br><span class="line">description:  #网站描述</span><br><span class="line">author: John Doe  #作者</span><br><span class="line">language:    #语言</span><br><span class="line">timezone:    #网站时区。Hexo 默认使用您电脑的时区。时区列表。比如说：America&#x2F;New_York, Japan, 和 UTC 。</span><br><span class="line"></span><br><span class="line"># URL</span><br><span class="line">## If your site is put in a subdirectory, set url as &#39;http:&#x2F;&#x2F;yoursite.com&#x2F;child&#39; and root as &#39;&#x2F;child&#x2F;&#39;</span><br><span class="line">url: http:&#x2F;&#x2F;yoursite.com   #你的站点Url</span><br><span class="line">root: &#x2F;                       #站点的根目录</span><br><span class="line">permalink: :year&#x2F;:month&#x2F;:day&#x2F;:title&#x2F;   #文章的 永久链接 格式   </span><br><span class="line">permalink_defaults:    #永久链接中各部分的默认值</span><br><span class="line"></span><br><span class="line"># Directory   </span><br><span class="line">source_dir: source   #资源文件夹，这个文件夹用来存放内容</span><br><span class="line">public_dir: public     #公共文件夹，这个文件夹用于存放生成的站点文件。</span><br><span class="line">tag_dir: tags         # 标签文件夹     </span><br><span class="line">archive_dir: archives    #归档文件夹</span><br><span class="line">category_dir: categories      #分类文件夹</span><br><span class="line">code_dir: downloads&#x2F;code     #Include code 文件夹</span><br><span class="line">i18n_dir: :lang                #国际化（i18n）文件夹</span><br><span class="line">skip_render:                #跳过指定文件的渲染，您可使用 glob 表达式来匹配路径。    </span><br><span class="line"></span><br><span class="line"># Writing</span><br><span class="line">new_post_name: :title.md # 新文章的文件名称</span><br><span class="line">default_layout: post     #预设布局</span><br><span class="line">titlecase: false # 把标题转换为 title case</span><br><span class="line">external_link: true # 在新标签中打开链接</span><br><span class="line">filename_case: 0     #把文件名称转换为 (1) 小写或 (2) 大写</span><br><span class="line">render_drafts: false  #是否显示草稿</span><br><span class="line">post_asset_folder: false  #是否启动 Asset 文件夹</span><br><span class="line">relative_link: false      #把链接改为与根目录的相对位址    </span><br><span class="line">future: true                #显示未来的文章</span><br><span class="line">highlight:                    #内容中代码块的设置    </span><br><span class="line">  enable: true</span><br><span class="line">  line_number: true</span><br><span class="line">  auto_detect: false</span><br><span class="line">  tab_replace:</span><br><span class="line">index_generator: # 首页文章列表页面</span><br><span class="line">  path: &#39;&#39;</span><br><span class="line">  per_page: 10 # 首頁显示多少篇文章，默认为10，如果值为0则不分页。由于首页会显示文章的摘要内容，建议不要取太大的数值，造成翻页定位困难</span><br><span class="line">  order_by: -date # 排序，默认时间逆序，即最新的在最上面</span><br><span class="line"></span><br><span class="line">archive_generator: # 归档文章列表页面</span><br><span class="line">  per_page: 20 # 默认10个文章标题，由于仅显示标题，可适当设置为较大的数值</span><br><span class="line">  yearly: true  # 生成年视图</span><br><span class="line">  monthly: true # 生成月视图</span><br><span class="line">  daily: false # 生成日视图，默认关</span><br><span class="line">  order_by: -date # 排序</span><br><span class="line"></span><br><span class="line">tag_generator: # 标签中各个标签下文章列表页面</span><br><span class="line">  per_page: 20 # 默认10篇文章</span><br><span class="line">  </span><br><span class="line">  </span><br><span class="line"># Category &amp; Tag</span><br><span class="line">default_category: uncategorized</span><br><span class="line">category_map:          #分类别名</span><br><span class="line">tag_map:            #标签别名</span><br><span class="line"></span><br><span class="line"># Date &#x2F; Time format</span><br><span class="line">## Hexo uses Moment.js to parse and display date</span><br><span class="line">## You can customize the date format as defined in</span><br><span class="line">## http:&#x2F;&#x2F;momentjs.com&#x2F;docs&#x2F;#&#x2F;displaying&#x2F;format&#x2F;</span><br><span class="line">date_format: YYYY-MM-DD         #日期格式</span><br><span class="line">time_format: HH:mm:ss        #时间格式    </span><br><span class="line"></span><br><span class="line"># Pagination</span><br><span class="line">## Set per_page to 0 to disable pagination</span><br><span class="line">per_page: 10    #分页数量</span><br><span class="line">pagination_dir: page  </span><br><span class="line"></span><br><span class="line"># Extensions</span><br><span class="line">## Plugins: https:&#x2F;&#x2F;hexo.io&#x2F;plugins&#x2F;</span><br><span class="line">## Themes: https:&#x2F;&#x2F;hexo.io&#x2F;themes&#x2F;</span><br><span class="line">theme: landscape   #主题名称</span><br><span class="line"></span><br><span class="line"># Deployment</span><br><span class="line">## Docs: https:&#x2F;&#x2F;hexo.io&#x2F;docs&#x2F;deployment.html</span><br><span class="line">#  部署部分的设置</span><br><span class="line">deploy:     </span><br><span class="line">  type:  #类型，常用的git</span><br></pre></td></tr></table></figure>



<p>​     2)package.json:hexo框架的参数和所依赖插件</p>
<p>​     3)scaffolds:脚手架,当你写一篇文章的时候，hexo根据此目录下的文件进行构建</p>
<p>​    4)source:新建的文章都是保存在这个目录下的_posts目录下，文件都是以.md结尾,后期编译成html文件，放在public对应时间文件夹下</p>
<p>​    5)themes:主题目录，该目录下，一个子目录就是一个主题，其中–landscape是默认主题</p>
<p>参考来源：<a href="https://www.jianshu.com/p/17d55d420d94" target="_blank" rel="noopener">https://www.jianshu.com/p/17d55d420d94</a></p>

      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2020/02/26/%E5%8D%95%E4%BE%8B%E6%A8%A1%E5%BC%8F/" rel="next" title="单例模式">
                <i class="fa fa-chevron-left"></i> 单例模式
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2020/03/20/sublime%E5%91%BD%E4%BB%A4/" rel="prev" title="sublime命令">
                sublime命令 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <p class="site-author-name" itemprop="name">suichen</p>
              <p class="site-description motion-element" itemprop="description">记录成长</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/%20%7C%7C%20archive">
              
                  <span class="site-state-item-count">14</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            

            

          </nav>

          

          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-第一次玩hexo，今天了解一下hexo的每个目录的作用，设置一下全局的配置文件-config-yml的相关参数，记录一下"><span class="nav-number">1.</span> <span class="nav-text">1.第一次玩hexo，今天了解一下hexo的每个目录的作用，设置一下全局的配置文件_config.yml的相关参数，记录一下</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-主目录介绍"><span class="nav-number">2.</span> <span class="nav-text">2.主目录介绍</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">suichen</span>

  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Gemini</a> v5.1.4</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  

  

  

</body>
</html>
